﻿using SrBBSPro.Entities;
using SrBBSPro.BaseClasses;
using System;

namespace SrBBSPro.Services
{
    /// <summary>
    /// zan
    /// </summary>
    public class LikeService : BaseService<Like,long>
    {
        /// <summary>
        /// 是否已赞
        /// </summary>
        /// <param name="commentId"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public bool ZanIsExists(long commentId, string userId)
        {
            return DbBase.Query<Like>().Any(p => p.CommentId == commentId && p.UserId == userId);
        }
    }
}
